# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Christoph Drexler <chrdr at gmx dot at>

pkgname=leptonica
pkgver=1.83.1
pkgrel=1
pkgdesc="Software that is broadly useful for image processing and image analysis applications"
arch=('loong64' 'x86_64')
url="http://www.leptonica.com/"
license=('custom')
depends=('giflib' 'libjpeg-turbo' 'libpng' 'libtiff' 'zlib' 'libwebp' 'openjpeg2')
source=("https://github.com/DanBloomberg/leptonica/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da')

prepare() {
  cd leptonica-${pkgver}
  ./autogen.sh
}

build() {
  cd leptonica-${pkgver}
  ./configure --prefix=/usr
  make
}

package() {
  cd leptonica-${pkgver}
  make DESTDIR="$pkgdir" install
  install -D leptonica-license.txt "$pkgdir"/usr/share/licenses/leptonica/leptonica-license.txt
}
